/**
 * @author 龙小虬
 * @date 2021/4/24 23:06
 */
public class Main extends Thread{
    private Object lock = new Object();

    @Override
    public void run() {
        b();
    }

    public void a() {
        synchronized (lock) {
            System.out.println("我是A");
            b();
        }
    }

    private void b() {
        synchronized (lock) {
            System.out.println("我是B");
        }
    }

    public static void main(String[] args) {

    }

}
